﻿using System;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using Newtonsoft.Json;
using SnakeGame.Models;
using SnakeGame.Views;
using SnakeGame.Helpers;


namespace SnakeGame.ViewModels
{
    public class StepWindowViewModel : DialogTemplateViewModel
    {
        public string Name { get; set; }
        public int Position { get; set; }
        public string Picture { get; set; }
        public int Win { get; set; }
        public int Lose { get; set; }

        private int? _goValue;
        public int? GoValue { get { return _goValue; } set { _goValue = value; OnPropertyChanged("GoValue"); } }

        public bool IsCancel;

        public StepWindowViewModel()
        {
            GoValue = null;
        }

        public void Initialize(Player p)
        {
            Name = p.PlayerName;
            Position = p.Position;
            Picture = p.CharacterPicture;
            Win = p.Win;
            Lose = p.Lose;
        }

        protected override void OnOkCommand(object obj)
        {
            IsCancel = false;
            base.OnOkCommand(obj);
        }

        protected override void OnCancelCommand(object obj)
        {
            IsCancel = true;
            base.OnCancelCommand(obj);
        }

    }
}
